* ----------------------------------- *
* ESTIMATION OF STATS IN FIRST STAGES * 
* ----------------------------------- *

clear all
set maxvar 120000 
set seed 12345

	
use "${source_data}\Data_Estimation_Elasticities.dta",clear
	
est clear

global exogenous ln_p_inpf_sbjo 
global endogenous ln_q_sbjo
global instrument ln_q_sbq_inst3b
global interaction relational_quartile
global product type_of_product
global fes gr_sjt

* Sample for estimation of elasticities
capture drop SAMPLE_THETA
gen SAMPLE_THETA=(S_pdsivf==1 & n_ud==1 )

* ----------------------------------------------------------------------------- *
* TABLE E5. First Stage Regressions and Diagnostics
* ----------------------------------------------------------------------------- *
* coefficients and standard errors in .dta produced in Bootrstrap_First_Stages.do

do "${floats}\TableE5PanelB.do"

capture drop int_exog* int_endog* int_inst*

keep  LM_* F_*
duplicates drop
sum
save "${replicated_data}\FirstStages_Stats.dta", replace
	
	